package test.h0815;

import java.util.Arrays;
import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i]=sc.nextInt();
        }
        int k=sc.nextInt();
        System.out.println(getRes(arr, n, k));
    }

    private static int getRes(int[] arr, int n, int k) {
        Arrays.sort(arr);
        int left=0;
        int right=0;
        int ans=0;
        for (int i = n-1; i >=0 ; i--) {
            if (arr[i]>=k){
                ans++;
            }else {
                right=i;
                break;
            }
        }
        while (left<right){
            if (arr[left]+arr[right]>=k){
                ans++;
                right--;
            }
            left++;
        }
        return ans;
    }
}
